//
//  DBProjectDownloadStatus.m
//  DownDemo
//
//  Created by 喂！ on 2018/11/7.
//  Copyright © 2018年 well. All rights reserved.
//

#import "DBProjectDownloadStatus.h"

@implementation DBProjectDownloadStatus


+(NSString *)getTableName
{
    return @"tb_ProjectDownloadStatus";
}

+(NSArray *)getPrimaryKeyUnionArray
{
    return @[@"Id",@"Type"];
}

+(void)updateDBVersion:(NSInteger)version
{
    if (version == 2) {
        NSMutableArray *arr = [DBProjectDownloadStatus searchWithWhere:nil];
        
        [[DBProjectDownloadStatus getUsingLKDBHelper] dropTableWithClass:[DBProjectDownloadStatus class]];
        
        [DBProjectDownloadStatus insertArrayByAsyncToDB:arr completed:^(BOOL allInserted) {
        }];
    }
    else if (version == 8)
    {
        [DBProjectDownloadStatus updateToDBWithSet:[NSString stringWithFormat:@"DownLength = %@",[NSNumber numberWithInteger:0]] where:@{@"Downloading":[NSNumber numberWithBool:false]}];
    }
}


@end
